#.rst:
# opentelemetry-cpp-fluentd.config.cmake
# --------
#
# Find the native opentelemetry-cpp-fluentd includes and library.
#
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
#   OPENTELEMETRY_CPP_FLUENTD_INCLUDE_DIRS  - Include directories of opentelemetry-cpp-fluentd.
#   OPENTELEMETRY_CPP_FLUENTD_LIBRARY_DIRS  - Link directories of opentelemetry-cpp-fluentd.
#   OPENTELEMETRY_CPP_FLUENTD_LIBRARIES     - List of libraries when using opentelemetry-cpp-fluentd.
#   OPENTELEMETRY_CPP_FLUENTD_FOUND         - True if opentelemetry-cpp-fluentd found.
#   OPENTELEMETRY_CPP_FLUENTD_VERSION           - Version of opentelemetry-cpp-fluentd.
#
# ::
#   opentelemetry-cpp-fluentd::trace                    - Imported target of opentelemetry-fluentd::trace
#   opentelemetry-cpp::logs                             - Imported target of opentelemetry-fluentd::logs

# =============================================================================
# Copyright 2020 opentelemetry.
#
# Distributed under the Apache License (the "License"); see accompanying file
# LICENSE for details.
# =============================================================================
set(OPENTELEMETRY_CPP_FLUENTD_VERSION
    "@OPENTELEMETRY_CPP_FLUENTD_VERSION@"
    CACHE STRING "opentelemetry-cpp-fluentd version" FORCE)

@PACKAGE_INIT@

message(OPENTELEMETRY_CPP_FLUENTD_VERSION)
find_package(Threads)

set_and_check(OPENTELEMETRY_CPP_FLUENTD_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(OPENTELEMETRY_CPP_FLUENTD_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@")

include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-target.cmake")

set(OPENTELEMETRY_CPP_FLUENTD_LIBRARIES)

set(_OPENTELEMETRY_CPP_FLUENTD_LIBRARIES_TEST_TARGETS
        trace
        logs)

foreach(_TEST_TARGET IN LISTS _OPENTELEMETRY_CPP_FLUENTD_LIBRARIES_TEST_TARGETS)
        if(TARGET opentelemetry-fluentd::${_TEST_TARGET})
                list(APPEND OPENTELEMETRY_CPP_FLUENTD_LIBRARIES opentelemetry-fluentd::${_TEST_TARGET})
        else()
                message("Target not found: " ${_TEST_TARGET})
        endif()
endforeach()

# handle the QUIETLY and REQUIRED arguments and set opentelemetry-cpp_FOUND to
# TRUE if all variables listed contain valid results, e.g. valid file paths.
include(CMakeFindDependencyMacro)
find_dependency(opentelemetry-cpp CONFIG)
find_dependency(nlohmann_json CONFIG)
